import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 */

public class Text {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        String s1 =in.nextLine();
//        in.nextLine();
        String s2 =in.nextLine();
        StringBuilder s3 =new StringBuilder(s1);
        for(int i=0;i<s2.length();i++){
            char ch =s2.charAt(i);
            int tmp=0;
            for(int j=0;j<s3.length();j++){
                if(ch==s3.charAt(j)){
                    tmp=j;
                    break;
                }
            }
            s3.deleteCharAt(tmp);
        }
        String s4=s3.toString();
        System.out.printf(s4);
    }
}
// public class Text {
//    public static void findException(int[] array,int index){
//        if (array==null){
//            throw new NullPointerException("空指针异常");
//        }
//        if (index<0||index>=array.length){
//            throw new ArrayIndexOutOfBoundsException("下标越界异常");
//        }
//    }
//    public static void main(String[] args) {
//        int[] array =new int[]{1,2,3};
//        //findException(array,3);
////        array=null;
////        findException(array,3);
//    }
//}
